Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Managing Bounding Boxes

QuickDraw 3D provides routines that you can use to manage bounding boxes.

Q3BoundingBox_Copy

You can use the Q3BoundingBox_Copy function to make a copy of a bounding box.

TQ3BoundingBox *Q3BoundingBox_Copy (
                     const TQ3BoundingBox *src,
                     TQ3BoundingBox *dest);
src
A pointer to the bounding box to be copied.
dest
On entry, a pointer to a buffer large enough to hold a bounding box. On exit, a pointer to a copy of the bounding box specified by the src parameter.

DESCRIPTION

The Q3BoundingBox_Copy function returns, as its function result and in the dest parameter, a copy of the bounding box specified by the src parameter. Q3BoundingBox_Copy does not allocate any memory for the destination bounding box; the dest parameter must point to space allocated in the heap or on the stack before you call Q3BoundingBox_Copy .

Q3BoundingBox_Union

You can use the Q3BoundingBox_Union function to find the union of two bounding boxes.

TQ3BoundingBox *Q3BoundingBox_Union (
                     const TQ3BoundingBox *v1,
                     const TQ3BoundingBox *v2,
                     TQ3BoundingBox *result);
v1
A pointer to a bounding box.
v2
A pointer to a bounding box.
result
On exit, a pointer to the union of the bounding boxes v1 and v2 .

DESCRIPTION

The Q3BoundingBox_Union function returns, as its function result and in the result parameter, a pointer to the bounding box that is the union of the two bounding boxes specified by the parameters v1 and v2 . The result parameter can point to the memory occupied by either v1 or v2 , thereby performing the union operation in place.

Q3BoundingBox_Set

You can use the Q3BoundingBox_Set function to set the defining points of a bounding box.

TQ3BoundingBox *Q3BoundingBox_Set (
                     TQ3BoundingBox *bBox,
                     const TQ3Point3D *min,
                     const TQ3Point3D *max,
                     TQ3Boolean isEmpty);
bBox
A pointer to a bounding box.
min
A pointer to a three-dimensional point.
max
A pointer to a three-dimensional point.
isEmpty
A Boolean value that indicates whether the specified bounding box is empty ( kQ3True ) or not ( kQ3False ).

DESCRIPTION

The Q3BoundingBox_Set function assigns the values min and max to the min and max fields of the bounding box specified by the bBox parameter. Q3BoundingBox_Set also assigns the value of the isEmpty parameter to the isEmpty field of the bounding box.

Q3BoundingBox_UnionPoint3D

You can use the Q3BoundingBox_UnionPoint3D function to find the union of a bounding box and a three-dimensional point.

TQ3BoundingBox *Q3BoundingBox_UnionPoint3D (
                     const TQ3BoundingBox *bBox,
                     const TQ3Point3D *pt3D,
                     TQ3BoundingBox *result);
bBox
A pointer to a bounding box.
pt3D
A three-dimensional point.
result
On exit, a pointer to the union of the specified bounding box and the specified point.

DESCRIPTION

The Q3BoundingBox_UnionPoint3D function returns, as its function result and in the result parameter, a pointer to the bounding box that is the union of the bounding box specified by the bBox parameter and the three-dimensional point specified by the pt3D parameter. The result parameter can point to the memory pointed to by bBox , thereby performing the union operation in place.

Q3BoundingBox_UnionRationalPoint4D

You can use the Q3BoundingBox_UnionRationalPoint4D function to find the union of a bounding box and a rational four-dimensional point.

TQ3BoundingBox *Q3BoundingBox_UnionRationalPoint4D (
                     const TQ3BoundingBox *bBox,
                     const TQ3RationalPoint4D *pt4D,
                     TQ3BoundingBox *result);
bBox
A pointer to a bounding box.
pt4D
A rational four-dimensional point.
result
On exit, a pointer to the union of the specified bounding box and the specified point.

DESCRIPTION

The Q3BoundingBox_UnionRationalPoint4D function returns, as its function result and in the result parameter, a pointer to the bounding box that is the union of the bounding box specified by the bBox parameter and the rational four-dimensional point specified by the pt4D parameter. The result parameter can point to the memory pointed to by bBox , thereby performing the union operation in place.

Q3BoundingBox_SetFromPoints3D

You can use the Q3BoundingBox_SetFromPoints3D function to find the bounding box that bounds an arbitrary list of three-dimensional points.

TQ3BoundingBox *Q3BoundingBox_SetFromPoints3D (
                     TQ3BoundingBox *bBox,
                     const TQ3Point3D *pts,
                     unsigned long nPts,
                     unsigned long structSize);
bBox
A pointer to a bounding box.
pts
A pointer to a list of three-dimensional points.
nPts
The number of points in the specified list.
structSize
The number of bytes of data that separate two successive points in the specified list of points.

DESCRIPTION

The Q3BoundingBox_SetFromPoints3D function returns, as its function result and in the bBox parameter, a pointer to a bounding box that contains all the points in the list of three-dimensional points specified by the pts parameter. The nPts parameter indicates how many points are in that list, and the structSize parameter indicates the offset between any two successive points in the list. By suitably specifying the value of the structSize parameter, you can have QuickDraw 3D extract points that are embedded in an array of larger data structures.

Q3BoundingBox_SetFromRationalPoints4D

You can use the Q3BoundingBox_SetFromRationalPoints4D function to find the bounding box that bounds an arbitrary list of rational four-dimensional points.

TQ3BoundingBox *Q3BoundingBox_SetFromRationalPoints4D (
                     TQ3BoundingBox *bBox,
                     const TQ3RationalPoint4D *pts,
                     unsigned long nPts,
                     unsigned long structSize);
bBox
A pointer to a bounding box.
pts
A pointer to a list of rational four-dimensional points.
nPts
The number of points in the specified list.
structSize
The number of bytes of data that separate two successive points in the specified list of points.

DESCRIPTION

The Q3BoundingBox_SetFromRationalPoints4D function returns, as its function result and in the bBox parameter, a pointer to a bounding box that contains all the points in the list of rational four-dimensional points specified by the pts parameter. The nPts parameter indicates how many points are in that list, and the structSize parameter indicates the offset between any two successive points in the list. By suitably specifying the value of the structSize parameter, you can have QuickDraw 3D extract points that are embedded in an array of larger data structures.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |